Mining unit test cases to synthesize API usage examples (2017)
API を利用するためには、その挙動をしっかり理解する必要がある
実際に動かして結果を見るのはいいけど時間がかかる
API ドキュメントは書かれてないことが多い
Code example を使ってAPIの挙動を理解するのはいいが、シュッと"良い" code example を見つけるのが重要
既存研究では以下のような研究が盛ん
githubなどから code example をマイニングする
stackoverflow などから見付けてくる
しかし、どんなに頑張っても外部から持ってきたcode exampleは
low-quality なものが混ざってることが多い (そもそもコンパイルが通らない、変な使われ方がされている)
最新の example に対応していない場合がある
tanishiking24.icon 実行結果がわからない
あんまり使われないAPIの code example はなかなか手に入らない
一方 unit test は以下のような情報を持ち良い code example
(1) how to correctly instantiate classes
(2) how to construct arguments for method calls, and
(3) the expected system state after the invocations of methods
また外部に公開されていないメソッドに対しても code example として利用できる
こういうパッケージにプライベートなメソッドはドキュメントが書かれていることが少ない
Unit test cases are usually executable, simple, and concise snippets that are conceived to run in isolation.
どんなもの?
まず各プロジェクトのテストのF-MUTを計算
API usage example を test code から synthesize する
この研究のexampleが一番 手動のやつに近いことが分かった
hr.icon
先行研究と比べてどこがすごい?
hr.icon
技術や手法のキモはどこ?
hr.icon
どうやって有効だと検証した?
hr.icon
議論はある?
hr.icon
次に読むべき論文は?